Adaptive coding of a prediction error in hybrid video coding

ABSTRACT

The present invention relates to a method for coding a video signal using hybrid coding, comprising: reducing temporal redundancy by block based motion compensated prediction in order to establish a prediction error signal, deciding whether to transform the prediction error signal into the frequency domain, or to maintain the prediction error signal in the spatial domain for encoding.

The invention relates to a method of coding and decoding, a coder and adecoder, and data signals using adaptive coding of the prediction error.

Up to date standardized video coding methods are based on hybrid coding.Hybrid coding provides a coding step in the time domain and a codingstep in the spatial domain. First, the temporal redundancy of videosignals is reduced by using a block based motion compensated predictionbetween the image block to be coded and a reference block from an imagethat has already been transmitted determined by a motion vector. Theremaining prediction error samples are arranged in blocks and aretransformed into the frequency domain resulting in a block ofcoefficients. These coefficients are quantised and scanned according toa fixed and well-known zigzag scanning scheme, which starts with thecoefficient representing the DC value. According to a typicalrepresentation, this coefficient is positioned among the low frequencycoefficients in the top left corner of a block. The zigzag scanningproduces a one-dimensional array of coefficients, which areentropy-coded by a subsequent coder. The coder is optimised for an arrayof coefficients with decreasing energy. Since the order of coefficientswithin a block is predetermined and fixed, the zigzag scanning producesan array of coefficients of decreasing energy, if the prediction errorsamples are correlated. The subsequent coding step may then be optimisedfor such a situation. For this purpose, the latest standard H.264/AVCproposes Context-Based Adaptive Binary Arithmetic Coding (CABAC) orContext-Adaptive Variable-Length Coding (CAVLC). However, the codingefficiency of the transform only is high, if the prediction errorsamples are correlated. For samples being only marginally correlated inthe spatial domain, the transform is less efficient.

It is an object of the present invention to provide a coding anddecoding method, respective coders and decoders, data signals as well ascorresponding systems and semantics for coding and decoding videosignals being more efficient than the prior art.

According to an aspect of the present invention, a method for coding avideo signal is provided being based on hybrid coding. The methodcomprises the steps of reducing temporal redundancy by block basedmotion compensated prediction in order to establish a prediction errorsignal, and deciding whether to transform the prediction error signalinto the frequency domain, or to maintain the prediction error signal inthe spatial domain.

According to a corresponding aspect of the present invention, a coder isprovided, which is adapted to apply hybrid coding of a video signal. Thecoder includes means for reducing the temporal redundancy by block basedmotion compensated prediction in order to establish a prediction errorsignal, and means for deciding whether to transform the prediction errorsignal into the frequency domain, or to maintain the prediction errorsignal in the spatial domain. According to this aspect of the invention,a concept and corresponding apparatuses, signals and semantics areprovided to decide adaptively whether to process the prediction errorsignal in the frequency or in the spatial domain. If the predictionerror samples have only small correlation, the subsequent steps ofcoding the samples may be more efficient and they would lead to areduced data rate compared to coding the coefficients in the frequencydomain. Therefore, an adaptive deciding step and adaptive control meansto make the decision are implemented by the present invention.Accordingly, in view of the prediction error signal, it is decidedwhether to use frequency domain transform or to maintain the predictionerror signal in the spatial domain. The subsequent coding mechanisms maybe the same as for the frequency domain, or they may be adaptedespecially to the needs of the samples in the spatial domain.

According to another aspect of the invention, the method for coding avideo signal, and in particular the deciding step is based on a costfunction. Generally, the decision whether to use the coefficients in thefrequency domain or the samples in the spatial domain may be based onvarious kinds of deciding mechanisms. The decision may be made for allsamples within a specific portion of a video signal at once, or e.g.even for a specific number of blocks, macroblocks, or slices. Thedecision may be based on a cost function, as for example a Lagrangefunction. The costs are calculated for both, coding in the frequencydomain and coding in the spatial domain. The decision is made for thecoding with lower costs.

According to another aspect of the present invention, the cost functionincludes the rate distortion costs for the coding in the spatial and inthe frequency domain. According to still another aspect of theinvention, the rate distortion costs may be calculated by the requiredrate and the resulting distortion weighted by a Lagrange parameter.Further, the distortion measure may be the mean square quantisationerror or the mean absolute quantisation error.

According to an aspect of the present invention, the samples in thespatial domain may be coded by essentially the same methods as beingused for the coefficients in the frequency domain. These methods mayinclude the CABAC or CAVLC coding methods. Accordingly, only little orno adaption of the coding mechanisms is necessary, if the adaptivecontrol means decide to switch between the frequency and the spatialdomain. However, it might also be provided to use different codingschemes for the coefficients in the two domains.

According to another aspect of the invention, a method for coding avideo signal is provided, which is based on hybrid coding. According tothis aspect of the invention, the temporal redundancy is reduced byblock based motion compensated prediction, and the samples of theprediction error signal are provided in the prediction error block inthe spatial domain. The samples are scanned from the prediction errorblock in order to provide an array of samples in a specific order.According to this aspect of the invention it is provided that thescanning scheme is derived from a prediction error image or a predictionimage. The scanning scheme according to this aspect of the inventiontakes account of the effect that the zigzag scan according to prior artfor the frequency domain may not be the most efficient scanning orderfor the spatial domain. Therefore, an adaptive scanning scheme isprovided, which takes account of the distribution of the samples and themagnitude of the samples in the spatial domain. The scanning scheme maypreferably be based on a prediction error image or a prediction image.This aspect of the invention takes account of the most probablepositions of the samples having the highest magnitude and samples beingmost probably zero. As the coding gain for the frequency domain ismainly based on the phenomenon that the low frequency components havelarger magnitudes, and most of the high frequency coefficients are zero,a very effective, variable code length coding scheme like CABAC or CAVLCmay be applied. However, in the spatial domain, the samples having thehighest magnitude may be located anywhere within a block. However, asthe prediction error is usually the highest at the edges of a movingobject, the prediction image or the prediction error image may be usedto establish the most efficient scanning order.

According to an aspect of the present invention, the gradients of theprediction image may be used to identify the samples with largemagnitudes. The scanning order follows the gradients within theprediction image in their order of magnitude. The same scanning order isthen applied to the prediction error image, i.e. the samples in theprediction error image in the spatial domain.

Further, according to still another aspect of the present invention, thescanning scheme may be based on a motion vector in combination with theprediction error image of the reference block. The scan follows themagnitudes of the prediction error in decreasing order.

According to one aspect of the invention, the scanning scheme is derivedfrom a linearcombination of the gradient of the prediction image and theprediction error image of the reference block in combination with amotion vector

According to another aspect of the present invention, a specific codefor the coding mechanisms, as for example CABAC or the like is usedbased on separately determined probabilities for the coefficients in thefrequency domain or the samples in the spatial domain. Accordingly, thewell-known prior art coding mechanisms may be adapted at least slightlyin order to provide the most efficient coding mechanism for the spatialdomain. Accordingly, the switching mechanism being adaptively controlledin order to code either in the spatial or in the frequency domain may befurther adapted to switch the subsequent coding steps for the samples orcoefficients in the respective domains.

According to an aspect of the present invention, a method for coding avideo signal is provided including a step of quantising the predictionerror samples in the spatial domain by a quantiser, which has eithersubjectively weighted quantitation error optimisation or mean squaredquantization error optimization. According to this aspect of theinvention, the quantiser used for quantising the samples in the spatialdomain may be adapted to take account of the subjectively optimal visualimpression of a picture. The representative levels and decisionthresholds of a quantiser may then be adapted based on correspondingsubjective or statistical properties of the prediction error signal.

Further, the present invention relates also to a decoding method and adecoding apparatus in accordance with the aspects set out here above.According to an aspect of the present invention, a decoder is providedincluding adaptive control means for adaptively deciding whether aninput stream of a coded video signal represents the prediction errorsignal of the coded video signal in the spatial domain or in thefrequency domain. Accordingly, the decoder according to this aspect ofthe present invention is adapted to decide for an incoming data stream,i.e. whether the prediction error signal is coded in the frequency or inthe spatial domain. Further, the decoder provides respective decodingmeans for each of the two domains, either the spatial or the frequencydomain.

Further, according to still another aspect of the present invention, thedecoder comprises a scan control unit for providing a scanning orderbased on a prediction signal or a prediction error signal. The scancontrol unit according to this aspect of the invention is adapted toretrieve the necessary information about the scanning order, in whichthe incoming samples of a block have been scanned during coding thevideo signals. Further, the decoder may comprise all means in order toinverse quantise and inverse transform the coefficients in the frequencydomain or to inverse quantise the samples in the spatial domain. Thedecoder may also include a mechanism to provide motion compensation anddecoding. Basically, the decoder may be configured to provide all meansin order to implement the method steps corresponding to the coding stepsexplained here above.

According to still another aspect of the present invention, a datasignal representing a coded video signal is provided, wherein the codedinformation of the prediction error signal in the data signal ispartially coded in the spatial domain and partially coded in thefrequency domain. This aspect of the invention relates to the codedvideo signal, which is a result of the coding mechanisms as set outabove.

Further, according to still another aspect of the invention, the datasignal may include side information indicating the domain in which aslice, a macroblock, or a block is coded, in particular informationwhether a slice, a macroblock or a block is coded in the spatial or inthe frequency domain. As the adaptive control according to the presentinvention provides that the prediction error signal is either coded inthe spatial domain or in the frequency domain, it is necessary toinclude corresponding information into the coded video signal.Therefore, the present invention provides also a specific information,which indicates the domain in which the specific portion, such as aslice, macroblock, or block has been coded.

Further, this aspect of the invention takes also account of thepossibility that a whole macroblock or a whole slice may be coded onlyin one of the two domains. So, if for example an entire macroblock iscoded in the spatial domain, this may be indicated by a single flag orthe like. Further, even a whole slice may be coded only in the frequencyor in the spatial domain, and a corresponding indicator could beincluded for the whole slice into the data stream. This results in adecreased data rate and a more efficient coding mechanism for the sideinformation.

The aspects of the present invention are explained with respect to thepreferred embodiments which are elucidated by reference to theaccompanying drawings.

FIG. 1 shows a simplified block diagram of an encoder implementingaspects according to the present invention,

FIG. 2 shows a simplified block diagram of a decoder implementingaspects of the present invention,

FIG. 3 shows a scanning scheme according to the prior art,

FIG. 4 shows scanning schemes according to the present invention, and

FIG. 5 illustrates the parameters used for an optimised quantiseraccording to the present invention.

FIG. 1 shows a simplified block diagram of an encoder according to thepresent invention. Accordingly, the input signal 101 undergoes a motionestimation based on which a motion compensation prediction is carriedout in order to provide a prediction signal 104, which is subtractedfrom the input signal 101. The resulting prediction error signal 105 istransformed into the frequency domain 106 and quantised by an optimisedquantiser 107 for the frequency related coefficients. The output signal120 of the quantiser 107 is passed to an entropy coder 113 whichprovides the output signal 116 to be transmitted, stored, or the like.By means of an inverse quantisation block 110 and inverse transformationblock 111, the quantised prediction error signal 120 is further used forthe next prediction step in the motion compensated prediction block 103.The inverse quantised an inverse DCT transformed prediction error signalis added to the prediction signal and passed to frame memory 122 storingpreceding images for the motion compensation prediction block 103 andthe motion estimation block 102. Generally, the present inventionsuggests to use in addition to the prior art an adaptively controlledmechanism 115 to switch between the frequency and the spatial domain fortransforming the prediction error signal 105. The adaptive control means115 produce signals and parameters in order to control the adaptivechange between the frequency and the spatial domain. Accordingly, anadaptive control information signal 121 is asserted to the two switchesswitching between the positions A and B. If the transformation iscarried out in the frequency domain, the two switches are in position A.If the spatial domain is used, the switches are switched to position B.Further, the side information signal 121, i.e. which of the domains hasbeen used for the coding procedure of a picture is also passed to theentropy coder 113. Accordingly, an appropriate information for thedevice is included into the data stream. Parallel to the frequencytransform, via an alternative path, the prediction error signal 105 ispassed to the quantiser 109. This quantisation block 109 providesoptimised quantisation for the prediction error signal 105 in thespatial domain. The quantised prediction error signal 124 in the spatialdomain may be passed to a second inverse quantisation block 112 andfurther to the back connection to the motion compensation predictionblock 103. Additionally, there is a scan control block 114 receivingeither the motion vector 123 and the inverse quantised prediction errorsignal 118, or the prediction signal 104 via connection 119. Block 117serves to encode the motion information.

The adaption control block 115 decides whether a block is to be coded inthe frequency or in the spatial domain, and it generates correspondingside information to indicate the domain. The decision made by theadaption control means is based on the rate distortion costs for thecoding in the spatial and for coding in the frequency domain. The domainhaving the lower rate distortion costs is selected for coding. Forexample, the rate distortion costs C are calculated by the required rateR and the resulting distortion D weighted by a Lagrange parameter L:C=L*R+D. As a distortion measure, the mean squared quantisation errormay be used, but also other measures are applicable, as for example themean absolute quantisation error. As Lagrange parameter L, the commonlyused Lagrange parameter for the coder control of H.264/AVC may be usedL=0.85*2^(((QP-12)/3)). Alternative methods for determining the ratedistortion costs are possible.

The adaption control 115 can alternatively control the coding method.This may be done for example based on the prediction signal or based onthe correlation in the prediction error, or based on the domain, theprediction error is coded in at a motion compensated position of alreadytransmitted frames.

FIG. 2 shows a simplified block diagram of an architecture of a decoderaccording to aspects of the present invention. Accordingly, the codedvideo data is input to two entropy decoding blocks 201 and 202. Theentropy decoding block 202 decodes motion compensation information, suchas motion vectors etc. The entropy decoding block 201 applies theinverse coding mechanism used in the coder, as for example decodingaccording to CABAC or CAVLC. If the encoder uses a different codingmechanism for the coefficients or the samples in the spatial domain, thecorresponding decoding mechanism is to be used in the correspondingentropy decoding blocks. Accordingly, the entropy decoding block 201produces the appropriate signals in order to switch between positions Aand B in order to use either the appropriate inverse quantisation pathfor the spatial domain, i.e. the inverse quantisation operation block206, or the appropriate blocks according to switch position A, i.e. theinverse quantisation block 203 and the inverse transform block 204. Ifthe prediction error is represented in the frequency domain, inversequantisation block 203 and inverse transformation block 204 apply thecorresponding inverse operations. As the samples in the spatial domainhave been arranged in a specific order in accordance with a scanmechanism according to aspects of the present invention, a scan controlunit 205 provides the correct order of the samples for the entropydecoding block 201. If the encoding has been carried out in the spatialdomain, the inverse transform block 204 and the inverse quantizationblock 203 are bypassed by an inverse quantisation operation in block206. The switching mechanism, to switch between frequency and spatialdomain (i.e. position A and B of the switches) is controlled by the sideinformation sent in the bitstream and decoded by the entropy decodingblock 201. Further, the inverse quantised signal in the spatial domain,or the inverse quantized and inverse transformed signal in the frequencydomain are summed with the motion compensated prediction picture inorder to provide the decoded video signals 210. The motion compensationis carried out in block 209 based on previously decoded video signaldata (previous pictures) and motion vectors. The scan control unit 205uses either the prediction image 208, or the prediction error signal 207in combination with the motion vector 212 to determine the correct scansequence of the coefficients. The scan mechanism may also be based onboth pictures, i.e. the prediction error picture and the predictionpicture. As explained for the coding mechanism with respect to FIG. 1,the scan sequence during coding may be based on a combination of theprediction error information 207 and the motion compensation vectors.Accordingly, the motion compensation vectors may be passed via a path212 to the scan control unit 205. Further, in correspondence to FIG. 1,there is a frame memory 211 storing the necessary and previously decodedpictures.

FIG. 3 shows a simplified diagram in order to illustrate the zigzag scanorder according to the prior art. Accordingly, the coefficients, whichare the result of a transform to the frequency domain (for example DCT)are arranged in a predetermined order as shown in FIG. 3 for a four byfour block. These coefficients are read out in a specific order, suchthat the coefficients representing the low frequency portions arelocated in the first left positions of a one-dimensional array. The moreon the bottom right of the array, the higher the correspondingfrequencies of the coefficients. As blocks to be coded often containsubstantial low frequency coefficients, the high frequency coefficients,or at least a majority of high frequency coefficients are zero. Thissituation can effectively be used to reduce the data to transmit it byfor example replacing large sequence of zeros by a single informationabout the number of zeros.

FIG. 4 shows a simplified illustrative example for a scan mechanismaccording to an aspect of the present invention. FIG. 4( a) shows themagnitude of the gradients in the prediction image for one block. Thevalues in each position of the block represent the gradient of theprediction image of the current block. The gradient itself is a vectorconsisting of a two components representing the gradient in horizontaland vertical direction. Each component may be determined by thedifference of the two neighboring samples or it may be determined by thewell-known Sobel-operator taking six neighboring samples into account.The magnitude of the gradient is the magnitude of the vector. If twovalues have the same magnitude, a fixed or predetermined scan order maybe applied. The scanning order follows the magnitude of the gradientvalues in the block as indicated by the dotted line. Once the scanningorder within the gradient prediction image is established, the samescanning order is applied to the quantised prediction error samples,which are shown in FIG. 4( b). If the quantised samples in the spatialdomain of the block shown in FIG. 4( b) are arranged in aone-dimensional array as indicated on the left side of FIG. 4( b) inaccordance with the scanning order established based on the magnitude ofthe gradients in the prediction image, the samples having a high valueare typically arranged first in the array, i.e. in the left positions.The right positions are filled with zeros as indicated in FIG. 4( b).

Instead of a scan controlled by the gradient, also other scans as e.g. apredefined scan or a scan controlled by the quantised prediction errorof already transmitted frames in combination with a motion vector, orcombinations thereof can be applied (the scan control relates to blocks114 or 205 as explained with respect to FIG. 1 and FIG. 2). In the caseof a scan controlled by the prediction error signal in combination witha motion vector, the scan follows the magnitudes of the quantizedprediction error samples of the block, the motion vector of the currentblock refers to, in decreasing order.

If the motion vector points to fractional sample positions, the requiredquantized prediction error samples may be determined using aninterpolation technique. This may be the same interpolation technique asused for the interpolation of the reference image in order to generatethe prediction samples.

In the case the scan is controlled by the combination of the predictionimage and the prediction error image in combination with a motionvector, linear combinations of the magnitudes of the gradients and ofthe quantized prediction error samples of the block, the motion vectorof the current block refers to, are calculated. The scan follows thevalues of these linear combinations. In addition, the method for thescan determination can be signalled for segments of the sequence, e.g.for each frame or for each slice or for a group of blocks. According tothe typical standard processing, the motion compensation vectors arealready considered, while the prediction image is determined.

According to another aspect of the present invention, the scanning ordermay also be based on the prediction error picture in combination with amotion vector. Further, combinations of the gradient principle asexplained above and the prediction error picture are conceivable.

FIG. 5 shows a simplified illustration being useful to illustrate thedefinition of an optimised quantiser according to aspects of the presentinvention. Accordingly, the three parameters a, b, and c are theparameters used to adapt the quantiser. According to the standardH.264/AVC, rate distortion optimised quantisers for the coefficientswith two different distortion measures are applied. The first measure isthe mean squared quantisation error, the second is the subjectivelyweighted quantisation error. According to the H.264/AVC standard, twoquantisers for the prediction error samples are developed. Since thedistribution of the prediction error is close to a Laplaciandistribution, scalar a dead-zone plus uniform threshold quantiser isused in the case of mean squared quantisation error optimisation. FIG. 5illustrates the parameters a, b, and c of the quantisation and inversequantisation.

Table 1 shows the parameters a, b, and c, which may be advantageouslyused for the commonly used QPs (Quantisation Parameter) in the H.264/AVCcoding scheme. The parameters a, b, c are the respective optimisedparameters for mean square quantisation error optimisation. However,this is only an example, and different or additional parameters may beuseful for different applications.

TABLE 1 Mean squared Subjectively weighted quantisation errorquantisation error optimisation optimisation QP a b c r₁ r₂ r₃ r₄ r₅ 239.6 1.6 2.7 0 11 28 46 66 26 14.8 1.4 4.8 0 14 36 58 110 29 22.2 1.4 6.90 20 54 92 148 32 30.2 1.4 9.3 0 28 76 130 220

For subjectively weighted quantisation error optimisation, a non-uniformquantiser is proposed with representative levels r_(i), −r_(i) anddecision thresholds in the middle of adjacent r_(i), which are alsoshown in table 1. If large prediction errors occur at the edges, visualmasking may be exploited. Accordingly, large quantisation errors may beallowed at the edges and small ones if the image signal is flat.H.264/AVC may use more than 4 QPs as shown in Table 1. Then Table 1 hasto be extended. H.264/AVC may use 52 different QPs. The basic idea fordetermining the appropriate representative values r_(i), −r_(i), isexplained here below with respect to FIG. 6.

FIG. 6 shows a simplified representation of the measured mean absolutereconstruction error of a picture element in the case of thesubjectively weighted quantisation in the frequency domain in FIG. 6( a)and in the spatial domain in FIG. 6( b). The measured mean absolutereconstruction error of subjectively weighted quantisation in thefrequency domain is shown as a function of the absolute value of theprediction error. For the absolute reconstruction error of subjectivelyweighted quantisation in the spatial domain, the representation levelsr_(i), are adjusted such that the mean absolute reconstruction error isthe same for quantisation in the frequency and spatial domain withrespect to the quantisation intervals in the spatial domain. Just as anexample, the values r₁, r₂, r₃, and r₄ for QP=26 as indicated in table 1are also present in FIG. 6( b). As a rule of thumb, a representativelevels r_(i) is approximately doubled if the value QP increases by 6.The quantiser design can also exploit other features of the visualsystem. Furthermore, quantisers can be used to create a quantisationerror with properties different to those of the H.264/AVC quantisers.

Entropy Coding of the Quantised Samples in the Spatial Domain

According to an aspect of the present invention, entropy coding in thespatial domain may be based on the same methods as for the quantisedcoefficients in the frequency domain. For the H.264/AVC standard, twopreferred entropy coding methods are CABAC and CAVLC. However, accordingto this aspect of the present invention, instead of coding the quantisedcoefficients in the frequency domain, quantised samples in the spatialdomain are coded by the above mentioned methods. As explained above, thescanning order may be changed in order to provide the same datareduction as for the frequency domain. As set out above, the scan in thespatial domain may be controlled by the magnitude of the gradient of theprediction image signal at the same spatial position. According to thisprinciple, the samples to be coded are arranged in an order of decreasein gradients, as already explained with respect to FIG. 4( a) and (b).Other scan mechanisms may also be applied as set out above. Further,separate codes, which means separate probability models in the case ofCABAC, may be used for the spatial domain according to aspects of thepresent invention. The code and in the case of CABAC the initialisationof the probability models may be derived from the statistics of thequantised samples. The context modelling in the spatial domain may bedone in the same way as in the frequency domain.

Coding of the Side Information

The adaptive control means explained with respect to FIG. 1 generatesthe information relating to the domain, in which a block is to be coded.The block size may be four by four or eight by eight picture elementsaccording to the size of the transform. However, according to differentaspects of the present invention, other block sizes independent of thesize of the transform may be applied. According to an aspect of thepresent invention, the side information includes specific flags, whichindicate whether the coding mechanism has adaptively been changed duringcoding. If for example all blocks of a slice are coded in the frequencydomain, this may be indicated by a specific bit in the coded video datasignal. This aspect of the invention may also relate to the blocks of amacroblock, which may all be coded in each of the two domains, or onlyin one domain. Further, the concept according to the present aspect ofthe invention may be applied to macroblocks and information may beincluded in the data stream which indicates whether at least one blockof a macroblock is coded in the spatial domain. Accordingly, the flagSlice_FD_SD_coding_flag may be used to indicate whether all blocks ofthe current slice are coded in the frequency domain, or whether at leastone block is coded in the spatial domain. This flag may be coded by asingle bit. If at least one block of the slice is coded in the spatialdomain, this may be indicated by the flag MB_FD_SD_coding_flag for eachindividual macroblock of the current slice, if all the blocks of thecurrent macroblock are coded in the frequency domain, or if at least oneblock is coded in the spatial domain. This flag may be coded conditionedon the flags of the already coded neighbouring blocks to the top and tothe left. If the last one of a macroblock is coded in the spatialdomain, this may be indicated by the flag FD_or_SD-Flag for each blockof the macroblock to be coded, if the current block is coded in thefrequency or in the spatial domain. This flag may be coded conditionedon the flags of the already coded neighbouring blocks to the top and tothe left. Alternatively, the side information may also be codedconditioned by the prediction signal or the prediction error signal incombination with a motion vector.

Syntax and Semantics

According to this aspect of the present invention, an exemplary syntaxand semantics allowing the incorporation of the aspects of the presentinvention into the H.264/AVC coding scheme is presented. Accordingly,the flag Slice_FD_SD_coding_flag may be introduced in the slice_headeras shown in table 2. The flag MB_FD_SD_coding_flag may be sent in eachmacroblock_layer as shown in table 3. In the residual_block_cabac it maybe signalled by the flag FD_or_SD_flag if the frequency domain coding orspatial domain coding is supplied for the current block, this is shownin table 4 here below. A similar scheme may be applied in other videocoding algorithms for the prediction error coding.

TABLE 2 slice_header( ){ C Descriptor . . . Slice_FD_SD_coding_flag 2u(1) . . .

TABLE 3 Macroblock_layer( ){ C Descriptor . . . If(Slice_FD_SD_coding_flag == 1){  MD_FD_SD_coding_flag 2 u(1), ae(v) { .. .

TABLE 4 residual_block_cabac{ C Descriptor . . . If(Slice_FD_SD_coding_flag == 1 && MB_FD_SD_Coding_flag == 1){ FD_or_SD_flag 3/4 u(1), ae(v)  If (FD_or_SD_flag == 1)}  Code_Prediction_error_in_spatial_domain  }  else{  Code_Prediction_error_in_frequency_domain  } } . . .

1-22. (canceled)
 23. A Method for coding a video signal using hybridcoding, comprising: reducing temporal redundancy by block based motioncompensated prediction in order to establish a prediction error signal,deciding whether to transform the prediction error signal into thefrequency domain, or to maintain the prediction error signal in thespatial domain for encoding.
 24. The method according to claim 23,wherein the step of deciding is based on a cost function.
 25. The methodaccording to claim 23, wherein the cost function includes the ratedistortion costs for the coding in the spatial and the coding in thefrequency domain.
 26. The method according to claim 25, wherein the ratedistortion costs are calculated by the required rate (R) and theresulting distortion (D) weighted by a Lagrange parameter.
 27. Themethod according to claim 26, wherein the distortion measure is the meansquare quantization error or the mean absolute quantization error. 28.The method according to claim 23, wherein the samples in the spatialdomain are coded by the same method as the coefficients in the frequencydomain.
 29. The method of claim 28, wherein the coding of thecoefficients is carried out according to CABAC or CAVLC.
 30. The methodfor coding a video signal using a hybrid coding, wherein the temporalredundancy is reduced by block based motion compensation prediction, themethod comprising: providing the samples of the prediction error signalin a prediction error block in the spatial domain, scanning the samplesin the prediction error block to provide an array of samples in aspecific order, wherein the scanning scheme is derived from a predictionerror image or a prediction image.
 31. The method of claim 30, whereinthe scanning scheme is derived from the gradient of the predictionimage, and/or wherein the scanning scheme is based on a motion vector incombination with the prediction error image of the reference block,and/or wherein the scanning scheme is derived from a linear combinationof the gradient of the prediction image and the prediction error imageof the reference block in combination with a motion vector.
 32. Themethod according to claim 29, wherein a specific code for CABAC is usedhaving separate probabilities for the spatial domain, and/or wherein aspecific code for CAVLC is used for the spatial domain.
 33. The methodof claim 23 or 30, comprising further quantizing the prediction errorsamples by a quantizer having subjectively weighted quantization erroroptimization or mean squared quantization error optimization in thespatial domain.
 34. A Data signal representing a coded video signal,comprising coded information of a prediction error signal beingpartially coded in the spatial domain and partially coded in thefrequency domain.
 35. The data signal according to claim 34, comprisinginformation relating to the domain in which a slice, a macroblock, or ablock is coded, in particular information whether a slice, macroblock,or block is coded in the spatial or in the frequency domain.
 36. Thedata signal of claim 35, comprising a slice_fd_sd_coding_flag, amb_fd_sd_coding_flag, and/or a fd_or_sd_flag information relating to thecoding used for a slice, a macroblock, or a block, respectively.
 37. AMethod for decoding a video signal using hybrid coding, comprising:decoding coded video data effectively in the frequency or the spatialdomain, in accordance with the coding mechanism used for coding thevideo signal data.
 38. The decoding method of claim 37, wherein thepositions of the prediction error signal samples received in aone-dimensional array are assigned to locations in a two-dimensionalarrangement are determined based on a previously received predictionerror signal or prediction image.
 39. A Coder for coding a video signalusing hybrid coding, comprising: means for reducing the temporalredundancy by block based motion compensated prediction in order toestablish a prediction error signal, and adaptive control means fordeciding whether to transform the prediction error signal into thefrequency domain, or to maintain the prediction error signal in thespatial domain.
 40. A Decoder for decoding a video signal being coded byuse of hybrid coding, comprising adaptive control means (201) foradaptively deciding whether an input stream of a coded video signalrepresents the prediction error signal of the coded video signal in thespatial domain or in the frequency domain.
 41. The decoder of claim 40comprising further scanning control means for providing a scanning orderbased on a prediction signal or a prediction error signal or on a linearcombination of both.